<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    用户名 <input type="text"><br>
    密码 <input type="text">
    <button onclick="pass()">登录</button>
    <script src="./node_modules/jquery/dist/jquery.js"></script>
    <script>
        function pass() {
            $.ajax({
                type: "post",
                url: "",
                data: {
                    username: $,
                    password:4
                },
                dataType: "json",
                success: (a) => {
                    localStorage.setItem("toker", a.token)
                },
                error: (e) => {
                    console.log(e);

                }
            })
        }
    </script>
</body>

</html>